package com.yangsir.mysite.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yangsir.mysite.pojo.Category;
import org.apache.ibatis.annotations.Update;

/**
* @author yf
* @description 针对表【category(文章类别)】的数据库操作Mapper
* @createDate 2024-08-09 13:57:30
* @Entity generator.pojo.Category
*/
public interface CategoryMapper extends BaseMapper<Category> {

    @Update("update category set article_num = article_num + 1 where id = #{id}")
    boolean addArticleCount(Long id);

    @Update("update category set article_num = article_num - 1 where id = #{id}")
    boolean reduceArticleCount(Long id);
}




